<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>微博【评论发送】</title>
        <link rel="shortcut icon" href="images/1.ico" >
        <style>
            *{
                margin: 0px;
                padding: 0px;
                list-style: none;
            }
            textarea{
                width: 800px;
                resize: none;
                margin:10px auto;
                display: block;
                outline: none;
            }
            ul{
                width: 800px;
                margin:0px auto;
            }
            li{
                margin:20px 0px;
                border:1px solid red;
                position: relative;
                padding:20px;
            }
            .del{
                position: absolute;
                right:-10px;
                top:-10px;
                cursor: pointer;
            }
            button{
                width: 800px;
                background:#f60;
                border:none;
                outline: none;
                display: block;
                margin:20px auto;
                line-height: 40px;
                color: white;
                cursor: pointer;
            }
            header{
                overflow:hidden;
                width: 802px;
                margin:10px auto;
                color:#1b7fb6;
            }
            body{
                background: skyblue;
            }
            div{
                background: #ffffff;
                width: 820px;
                margin:auto;
            }


             main{
                 padding-top: 200px;   
             }
             main img:nth-of-type(1){
                animation: pao 3s infinite linear;
             }
             main img:nth-of-type(2){
                animation: pao 13s infinite linear;
             }
             main img:nth-of-type(3){
                animation: pao 6s infinite linear;
             }
             main img:nth-of-type(4){
                animation: pao 8s infinite linear;
             }
             main img:nth-of-type(4){
                animation: pao 5s infinite linear;
             }
             main img:nth-of-type(5){
                animation: pao 7s infinite linear;
             }
             main img:nth-of-type(6){
                animation: pao 4s infinite linear;
             }
             main img:nth-of-type(7){
                animation: pao 8s infinite linear;
             }
             @keyframes pao{
                 0%{
                     transform: translate(0px,0px)
                 }
                 100%{
                     transform: translate(0px,-200px)
                 }
             }
        </style>
    </head>
    <body>
        <main>
            <img src="images/pao02.png" alt="">
            <img src="images/pao02.png" width="10px" alt="">
            <img src="images/pao02.png" alt="">
            <img src="images/pao02.png" width="9px" alt="">
            <img src="images/pao02.png" alt="">
            <img src="images/pao02.png" width="12px" alt="">
            <img src="images/pao02.png" alt="">
      </main>
        <div>
        <header>
            <em class="a1">有什么新</em>
            <em class="a2">鲜</em>
            <em class="a3">事告诉大家</em>
            <em class="a4">？</em>
        </header>
            
        <textarea name="" id="txt" cols="30" rows="10"></textarea>
        <button id="btn">发送</button>
    </div>
        <ul id="box">
            <li>
                今天端午节，愿你我皆安康！
                <p>20:56</p>
                <p>2021-06-14</p>
                <span class="del" onclick="del(this)">X</span>
            </li>
            </ul>
            


        <script>
            var btn=document.getElementById('btn');
            var txt=document.getElementById('txt');
            var box=document.getElementById('box');
            var year=new Date().getFullYear()
            var month=new Date().getMonth()+1
            var date=new Date().getDate()
            var hour=new Date().getHours();
            var minute=new Date().getMinutes();

            btn.onclick=function(){
                if(txt.value==''){
                    alert('请输入数据')
                }
                else{
                var val=txt.value;
                var tag=document.createElement('li');
                tag.innerHTML=`${val}
                <p>${hour}:${minute}</p>
                <p>${year}-${month}-${date}</p>
                
                <span class="del" onclick="del(this)">X</span>`;
                box.appendChild(tag);}
                
            }

            function del(a){
                a.parentNode.parentNode.removeChild(a.parentNode)
            }
        </script>
    </body>
    </html>